<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta http-equiv="Pragma" content="no-cache" >
<meta http-equiv="Cache-Control" content="no-cache" >
<meta http-equiv="Expires" content="-1" >

<link rel="shortcut icon" href="/icon/info.niwota.home">
<title>Home Fling</title>
<base href="/content/info.niwota.home/" target="_self" >

<link rel="stylesheet" href="/style/common.css" type="text/css">


<style type="text/css">
.wrapper { 
	margin-top: 32px;
	margin-bottom: auto;
	margin-left: 32px;
	margin-right: 32px;
	width: 800px; 
	text-align: left; 
	border: none; 
	clear: both;
}

.cell {
  margin: 2px;
  height: auto;
  width: auto;
  float: left;
  text-align: center;
}

.cell img {
  display: inline;
  width: 32px;
  heigh: 32px;  
  margin: 0px;
  padding: 0px;
  border: none;
}

.cell:hover {
	background-color: orange;
}

.caption {
  text-align: center;
  font-weight: bold;
  width: 100px;
  color: #fff;
  margin: 2px;
}

.breadcrumb {
}

.stats {
	color: #fff;
}
</style>

<script type="text/javascript" src="/opt/script/jquery.js"></script>
<script type="text/javascript" src="/script/common.js"></script>
<script type="text/javascript" src="/content/info.niwota.home/script/custom.js"></script>

<script type="text/javascript">
var spinner = '<img src="/image/spin.gif" alt="Please wait..." ><span style="color: white; font-size: xx-large;">...<blink>.....</blink></span>';

function initPage() {
	$('#list').html(spinner);
	$.get('/assets/bin/list?path=/', function(d) {
		loadPage(d);
	});
}

$(document).ready(function(){
	initPage();
	//
	$.initOptionMenu();
});
</script>


<script type="text/javascript">

function initPage() {
	if (!data) {
		return;
	}
	$('#breadcrumb').html(data.breadcrumb);
	$('#file-content').html(data.filecontent);
	//$('#file-index').html(data.fileindex);
	$('#stats').html(data.filetotal + ' (' + data.elapsed + ' ms)');
	var twist = '<a href="/content/info.niwota.home/bin/changeview?view=' + data.view + '&path=' + encodeURIComponent(data.path) + '"><img src="' + data.twister + '" style="border: none;" ></a>';
	$('#twister').html(twist);
	document.title = data.path;
	//
	$('a.change-view').live('click', function() {
  		var link = $(this);
		document.location.replace(link.attr('href')+'&path=' + encodeURIComponent(data.path));
   		return false;
   	});
   	//
   	removeCookie('info.niwota.home.view');
   	setCookie('info.niwota.home.view', data.view, 1);
}

function breadcrumb(s) {
	if (s) {
		var sep = '&gt;&gt;';
		var a = s.substring(1).split('/');
		var bc = $('#breadcrumb');
		bc.empty();
		bc.append('<span><a target="_self" onclick="return doList(this);" href="/assets/bin/list?path=/"><img src="/opt/tango-icon-theme/22x22/places/user-home.png" >/</a></span>');
		var p = "";
		for (var i = 0; i < a.length; i++) {
			p = p + "/" + a[i];
			bc.append(sep + '<span><a class="action" target="_self" onclick="return doList(this);" href="/assets/bin/list?path=' + encodeURIComponent(p) + '">' + a[i] + '</a></span>');
		}
	}
}

function doList(a) {
	$('#list').html(spinner);
	$.get(a.href, function(d) {
		loadPage(d);
	});
	return false;
}

function formatFolder(o) {
/*
	String path = pathcat(context, p);
	sb.append("<tr>");
	String pathname = pathcat(path, name);
	if (name.endsWith(".zip")) {
		sb.append("<td><img src=\"" + iconpath);
		sb.append("filefolder.png");
	} else if (name.endsWith(x.java.io.File.LINK_EXT)) {
		sb.append("<td><img src=\"" + iconpath);
		sb.append("link.png");
	} else if (isFile) {
		String icon = icon(type);
		if (icon == null) {
			// TODO
			sb.append("<td><img src=\"" + iconpath + icon);
		} else {
			sb.append("<td><img src=\"" + iconpath + icon);
		}
	} else {
		// folder
		sb.append("<td><img src=\"" + iconpath);
		sb.append("folder.png");
	}
	sb.append("\" />");
	sb.append("</td><td><a  class=\"file-link\" href=\"");

	if (isFile) {
		sb.append(pathname);
	} else {
		// folder
		sb.append(pathname);
		sb.append("/");
	}
	sb.append("\" target=\"");
	sb.append(isFile ? "_blank" : "_self");
	sb.append("\" title=\"");
	sb.append(name);
	if (!isFile) {
		sb.append("/");
	}
	sb.append("\">");
	sb.append(shorten(display, MAX_NAME_LEN));
	if (!isFile) {
		sb.append("/");
	}
	sb.append("</a></td><td align=\"right\"><span class=\"file-size\">");
	if (isFile) {
		x.java.io.File.formatSize(length, sb);
	}
	sb.append("</span></td><td><span class=\"file-date\">");
	sb.append(df.format(date));
	sb.append("</span></td></tr>");
	sb.append("\r\n");
	*/
}
</script>
</head>
<body>

<div id="topnav">
	<span class="breadcrumb" id="breadcrumb">
	</span>
	
	<span class="top-center">
	</span>
	
	<span class="top-right" style="margin-right: 64px;">
	<span class="action"><a class="change-view" href="/content/info.niwota.home/bin/changeview?view=2" >List</a></span>&nbsp;.&nbsp;
	<span class="action"><a class="change-view" href="/content/info.niwota.home/bin/changeview?view=0" >Icon</a></span>&nbsp;.&nbsp;
	<span class="action"><a class="change-view" href="/content/info.niwota.home/bin/changeview?view=1" >Strip</a></span>&nbsp;|&nbsp;
	<span class="action"><a href="#" onclick="self.close();">Quit</a></span>
	</span>
</div>

<!--page content-->
<div id="page-content">

<div style="clear: both;"></div>

<div id="file-content" style="margin-top: 32px;">
</div>

<div style="clear: both;"></div>

<hr class="separator" />

<div>

<span class="file-indexes" >

<span id="file-index"></span> <span class="stats" id="stats"></span>

</span>

</div>


<hr class="separator" />

</div>
<!--//page content-->

<div id="optionmenu">
<a class="change-view" href="/content/info.niwota.home/bin/changeview?view=2" title="List" ><img src="/drawable/ic_menu_listview" /></a>
<a class="change-view" href="/content/info.niwota.home/bin/changeview?view=0" title="Icon" ><img src="/drawable/ic_menu_iconview" /></a>
<a class="change-view" href="/content/info.niwota.home/bin/changeview?view=1" title="Strip" ><img src="/drawable/ic_menu_stripview" /></a>
<a href="#" title="Quit" onclick="self.close();"><img src="/drawable/ic_menu_done" /></a>
</div>

<div id="footer">
<span style="color: #fff;">Home Fling 2.0.0 &copy; 2010 All rights reserved</span> <span id="twister" class="bottom-right" ></span>
</div>

<div id="wallpaper" style="display: block;"><img src="/wallpaper" width="100%" height="100%" /></div>

</body>
</html>